def GCD1(a,b):
    while 1:
        c=a%b
        if c==0:
            return b
        else:
            a=b
            b=c

def GCD2(a,b):
    while 1:
        if a>b:
            a=a-b
        else:
            if a<b:
                b=b-a
            else:
                if a==b:
                    return a

def LCM(a,b):
    c=GCD1(a,b)
    d=a*b/c
    return d

print LCM(27,15)
print GCD1(27,15)
print GCD2(27,15)

def LCM2(a,b):
    d=GCD1(a,b)
    m=a*b/d
    return m

print LCM2(27,15)